package com.cike.productmanager;

import com.cike.productmanager.util.DataApplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class ReadActContent extends Activity {

	private TextView readstorename;
	private TextView readactname;
	private TextView readstarttime;
	private TextView readendtime;
	private TextView salernum;
	private TextView salegoal;
	private TextView require;
	private TextView importance;
	
	private Button displayguidebutton;
	private Button relationbutton;
	
	private Button feedbackbutton;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.readactivity);
		
		Intent intent=getIntent();
        final int ID= intent.getIntExtra("ID", 0);
		
		
		readstorename=(TextView)findViewById(R.id.readstorename);
		readactname=(TextView)findViewById(R.id.readactname);
		readstarttime=(TextView)findViewById(R.id.readstarttime);
		readendtime=(TextView)findViewById(R.id.readendtime);
		salernum=(TextView)findViewById(R.id.salernum);
		salegoal=(TextView)findViewById(R.id.salegoal);
		require=(TextView)findViewById(R.id.require);
		importance=(TextView)findViewById(R.id.importance);
		
		
		displayguidebutton=(Button)findViewById(R.id.displayguidebutton);
		relationbutton=(Button)findViewById(R.id.relationbutton);
		feedbackbutton=(Button)findViewById(R.id.feedbackbutton);
		
		
		feedbackbutton.setOnClickListener(new View.OnClickListener() {
			
			/*在这里加入需要的门店信息传值，intent传值传一个ID，然后在CheckActivity
     	       中从ID获取数据库信息*/
			@Override
			public void onClick(View v) {
				
				Intent intent = new Intent (ReadActContent.this,CheckActivity.class);			
				
				//传递排序过去
				intent.putExtra("ID", ID);
				
				startActivity(intent);
				
				
			}
		});
		
		String storename = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getStoreBelong();
        String actname = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getActivityName();
        String startTime = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getStringStartTime();
        String endTime = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getStringEndTime();
        int num = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getSaleNumber();
        int imp = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getImportance();
        String goal = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getSalegoal();
        String req = ((com.cike.productmanager.adt.AActivity)DataApplication.activityList.get(ID)).getRequire();
        
		readstorename.setText(storename);
		readactname.setText(actname);
		readstarttime.setText(startTime);
		readendtime.setText(endTime);
		salernum.setText(String.valueOf(num));
		salegoal.setText(goal);
		require.setText(req);
		importance.setText(String.valueOf(imp));
	}
	
	
	
	
}
